<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="format-detection" content="telephone=no">
    <meta name="msapplication-tap-highlight" content="no">
    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
    <title><%- (blocks[block] || '').replace(/\//g, ' - ') %></title>
    <link rel='stylesheet' href='<%- rootUrl %>/res/adapter.css' />
    <link rel='stylesheet' href='<%- rootUrl %>/node_modules/font-awesome/css/font-awesome.min.css'/>
    <style>
        .fa {cursor:unset}
        .nav-head a {color:#3e62a6}
        .nav-head a:first-child {margin-left:-6px}
        .nav-head a:hover {color:#0000ee}
        .article-list { margin:0 0 12px 0 }
        .article-list > div:first-child b, .appends-list > div:first-child b {color:#19334d}
        .article-list > div { border-bottom:1px solid gainsboro;padding:12px 0;margin:0 12px}
        .article-list > div:first-child, .article-list > div:last-child { border-bottom:0 }
        .article-list > div > a > p:last-child { color:dimgrey; font-size:13px }
        .article-list > div img { max-height:120px; margin-right:3px; max-width: 100% }
        .article-list > div > p:last-child { color:darkgrey; font-size:11px }
        .appends-list { border:1px solid gainsboro }
        .appends-list > div { padding:9px 12px }
        .appends-list > div:not(:first-child) {font-size:15px;text-indent:0.5em}
        .appends-list a {color:#3e62a6}
        .appends-list a:hover {color:#0000ee}
    </style>
    <script src="<%- rootUrl %>/node_modules/jquery/dist/jquery.min.js"></script>
    <script src="<%- rootUrl %>/res/adapter.js"></script>
</head>
<body class="body-nomargin">
<alljs-widget><message-top><%- message %></message-top></alljs-widget>
<%- components['signhead'] ? include(components['signhead'], this) : '' %>
<div class="width-limit">
<div class="padding-leftright">
<% if (blockRoot in blocksDic){ %>
<h2><%- blocks[blockRoot] %>
    <span class="nav-head">
        <% var parts=blocksDic[block].split('/'); %>
        <% for(let i=0;i<parts.length;i++){ var url='';for(let j=parts.length-1;j>i;j--) url+='../' %><% let txt=i===0?'首页':parts[i];if (i===parts.length-1){ %><b><%- txt %></b><% }else{ %><a href="<%- url %>"><%- txt %></a> >&nbsp;<% } } %>
        <% var childs=[];var reg = new RegExp('^'+block+'/[^/]+$');for(let key in blocksDic){ if (key.match(reg)) {childs.push({path:key.substr(key.lastIndexOf('/')+1), name:blocksDic[key].substr(blocksDic[key].lastIndexOf('/')+1)}); } } %>
    </span>
    <span class="nav-head">
    <% for (let i=0;i<childs.length;i++){ %><a href="<%- childs[i].path %>/"><%- childs[i].name %></a><%- i===childs.length-1?'':' |&nbsp;' %><% } %>
    </span>
</h2>
<% } %>
</div>
<div class="adapt-panel">
    <div class="adapt-two-left article-list">
        <div class="adapt-panel"><b style="flex-grow:1"><i class="fa fa-bars"></i>&nbsp;文章列表</b><button onclick="location.href='./articlepublic.html'" style="margin-right:6px"><i class="fa fa-plus" style="color:green"></i> 新文章</button><button onclick="location.href='./articlereproduce.html'"><i class="fa fa-share" style="color:royalblue"></i> 转载</button></div>
        <% for (let article of articles) { %>
        <div>
            <a href="./article?id=<%- article._id %>">
                <p><% if(article.badge){ %><span class="badge" style="background-color:<%- article.badge.color %>"><%- article.badge.text %></span><% } %><%- article.title %></p>
                <p><%- article.brief %></p>
            </a>
            <% if (article.briefImages != null && article.briefImages.length > 0) { %>
            <div><% for (let i=0; i < Math.min(article.briefImages.length, 3); i++) { %><img src="<%- article.briefImages[i] %>" /><% } %></div>
            <% } %>
            <p class="adapt-panel"><span style="flex-grow:1"><%- article.author?article.author+' &nbsp; ':'' %><%- article.publish?article.publish+' &nbsp; ':'' %>发布人:<%- article.produceUser.nickname %></span>
                <span>
                    <% if(isAdmin && (blockRoot==='' || article.mainclass.substr(0,block.length)===block)){ %>
                    <button class="button-likeText" onclick="forbit('<%- article._id %>')" <%- article.status===1?'style="color:red"':'' %>/><i class="fa fa-ban"></i></button>
                    <button class="button-likeText" onclick="promote('<%- article._id %>', '<%- article.popular<100000000 %>')" <%- article.popular>=100000000?'style="color:red"':'' %>><i class="fa fa-arrow-up"></i></button>
                    &nbsp;
                    <% } %>
                    <i class="fa fa-thumbs-up"></i> <%- article.fonds %> &emsp;<i class="fa fa-comment"></i> <%- article.replys %>
                </span>
            </p>
        </div>
        <% } %>
    </div>
    <div class="adapt-two-right" style="padding:0 6px 6px 6px">
        <%- include('com.userpanel.html', this) %>
        <div class=" appends-list" style="margin-top:24px">
            <div><b><i class="fa fa-th-large"></i>&nbsp;网站功能</b></div>
            <div><a href="./chat.html"><span>板块聊天室</span></a></div>
            <div><a href="./chat.html?channel="><span>自建聊天室</span></a></div>
            <% if(signined){ %>
            <div><a href="./search.html"><span>搜索文章</span></a></div>
            <% } %>
        </div>
        <div class=" appends-list" style="margin-top:24px">
            <div><b><i class="fa fa-globe"></i>&nbsp;Alljs子站</b></div>
            <div><a href="<%- rootUrl %>/alljs/"><span>Alljs社区</span></a></div>
            <div><a href="<%- rootUrl %>/funs/"><span>老爸老妈快乐站</span></a></div>
            <div><a href="<%- rootUrl %>/babyedu/"><span>祖国的花朵栽培网</span></a></div>
            <div><a href="<%- rootUrl %>/econexam/"><span>经济类职业考试网</span></a></div>
            <div><a href="<%- rootUrl %>/dd/"><span>尽职调查</span></a></div>
            <div><a href="<%- rootUrl %>/mili/"><span>军武爱好者</span></a></div>
            <div><a href="<%- rootUrl %>/season/"><span>四季风采</span></a></div>
            <div><a href="<%- rootUrl %>/snack/"><span>我爱零吃网</span></a></div>
            <div style="color:dimgrey">想建站的请联系：15920372250 (何先生)</div>
            <div><a href="<%- rootUrl %>/alljs/userrequirements.html"><span>建站需求表</span></a></div>
        </div>
        <% if(isAdmin){ %>
        <div class=" appends-list" style="margin-top:24px">
            <div><b><i class="fa fa-gears"></i>&nbsp;站点管理</b></div>
            <div><a href="./publishaudit.html"><span>发布审核</span></a></div>
            <% if(isSuperAdmin){ %>
            <div><a href="./sitestatistics.html"><span>站点统计</span></a></div>
            <div><a href="./admin.html"><span>管理权限</span></a></div>
            <div><a href="./block.html"><span>管理板块</span></a></div>
            <div><a href="./sitemonitor.html"><span>站点监控</span></a></div>
            <div><a href="./manageEverything.html?col=meta"><span>管理数据库</span></a></div>
            <div><a href="<%- rootUrl %>/api/mongo.html"><span>Mongo数据接口</span></a></div>
            <div><a href="<%- rootUrl %>/measuresize.html"><span>测量页面尺寸</span></a></div>
            <div><a href="<%- rootUrl %>/upfile.html"><span>上传文件</span></a></div>
            <div><a href="<%- rootUrl %>/zoo/"><span>测试板块</span></a></div>
            <div><a href="<%- rootUrl %>/zoo/pig.html"><span>测试/小猪猪</span></a></div>
            <div><a href="<%- rootUrl %>/zoo/cat.html"><span>测试/小猫咪</span></a></div>
        </div>
        <div class=" appends-list" style="margin-top:24px">
            <div><b><i class="fa fa-book"></i>&nbsp;开发速查</b></div>
            <div><a href="<%- rootUrl %>/doc/Nodejs Mongodb Driver.html"><span>Mongodb Collection API</span></a></div>
            <div><a href="<%- rootUrl %>/doc/Nodejs Redis Driver.html"><span>Redis API</span></a></div>
            <div><a href="<%- rootUrl %>/doc/Nodejs fs Driver.html"><span>Filesystem API</span></a></div>
            <div><a href="<%- rootUrl %>/doc/Query and Projection Operators.html"><span>Mongodb Query 操作符</span></a></div>
            <div><a href="<%- rootUrl %>/doc/Update Operators.html"><span>Mongodb Update 操作符</span></a></div>
            <div><a href="<%- rootUrl %>/doc/jQuery API.html"><span>jQuery API</span></a></div>
            <div><a href="<%- rootUrl %>/doc/jQuery Manual.html"><span>jQuery 速查</span></a></div>
            <div><a href="<%- rootUrl %>/doc/Font Awesome.html"><span>Font Awesome API</span></a></div>
            <div><a href="<%- rootUrl %>/doc/Regular Expression.html"><span>Regular Expression 速查</span></a></div>
            <div><a href="<%- rootUrl %>/doc/Xpath,CSS manul.html"><span>CSS,Xpath 速查</span></a></div>
            <% }%>
        </div>
        <% } %>
        <% if (blockRoot==='' || blockRoot=='alljs'){ %>
        <div class=" appends-list" style="margin-top:24px">
            <div><b><i class="fa fa-external-link-square"></i>&nbsp;友情链接</b></div>
            <div><a href="javascript:window.open('https://github.com/')" ><span>Github</span></a></div>
            <div><a href="javascript:window.open('https://sourceforge.net/')" ><span>SourceForge</span></a></div>
            <div><a href="javascript:window.open('https://stackoverflow.com/')" ><span>Stack Overflow</span></a></div>
            <div><a href="javascript:window.open('https://msdn.microsoft.com/library/')" ><span>MSDN</span></a></div>
            <div><a href="javascript:window.open('https://www.npmjs.com/')" ><span>NPM</span></a></div>
            <div><a href="javascript:window.open('http://www.w3school.com.cn/')" ><span>W3school</span></a></div>
            <div><a href="javascript:window.open('https://www.runoob.com/')" ><span>菜鸟教程</span></a></div>
            <div><a href="javascript:window.open('https://www.csdn.net/')" ><span>CSDN</span></a></div>
            <div><a href="javascript:window.open('https://www.oschina.net/')" ><span>开源中国</span></a></div>
            <div><a href="javascript:window.open('https://www.bootcdn.cn/')" ><span>BootCDN</span></a></div>
            <div><a href="javascript:window.open('https://www.javascriptcn.com/')" ><span>JavaScript中文网</span></a></div>
            <div><a href="javascript:window.open('https://segmentfault.com/')" ><span>SegmentFault思否</span></a></div>
            <div><a href="javascript:window.open('http://ourjs.com/')" ><span>OurJS社区</span></a></div>
            <div><a href="javascript:window.open('https://www.bootcss.com/p/layoutit/')" ><span>Layoutit-3</span></a></div>
            <div><a href="javascript:window.open('https://www.layoutit.com/build')" ><span>Layoutit-4</span></a></div>
        </div>
        <% } %>
    </div>
</div>
</div>
<div style="width:100%;margin-top:12px;border-top:1px solid gainsboro"><div class="width-limit childs-padding-leftright adapt-panel" style="color:darkgrey;font-size:11px">
    <p>Tel : (+86)15920372250</p><p>Email : aelue@126.com</p><p>Copyright (c) 2019 He Su</p><p>All Rights Reserved</p><p><a href="http://beian.miit.gov.cn">粤ICP备19071825号</a></p>
</div></div>
<% if(isAdmin){ %>
<script>
function forbit(id){
    window.postRequest('./deleteSomething', {col:'article',type:'forbid',filter:'{"_id":"'+id+'"}'});
}
function promote(id, isPromote){
    isPromote = isPromote === 'true';
    window.postRequest('./articlePromote', {type:(isPromote ? 'promote' : 'demote'),id});
}
</script>
<% } %>
<% if(isSuperAdmin){ %>
<script>
$(function() {
    var ele = $('.article-list');
    var dom = '<div class="childs-padding-leftright adapt-panel" style="color:darkgrey;font-size:12px">';
    dom+='<p>express supporting</p>';
    dom+='<p>ejs-engine supporting</p>';
    dom+='<p>mongodb supporting</p>';
    dom+='<p>redis supporting</p>';
    dom+='<p>socket.io supporting</p>';
    dom+='<p>pkg supporting</p>';
    dom+='<p>forever supporting</p>';
    dom+='<p>webpack supporting</p>';
    var mordenBrowser = 'fetch' in window && 'assign' in Object;
    dom+='<p>' + (mordenBrowser ? 'browser es6 supporting (no polyfill)' : 'babel-polyfill supporting') + '</p>';
    var isCordova = '_cordovaNative' in window;
    dom+='<p>' + (isCordova ? 'cordova supporting' : 'web-browser supporting (no cordova)') + '</p>';
    dom+='<p>jquery supporting</p>';
    dom+='</div>';
    ele.append(dom);
});
</script>
<% } %>
</body>
</html>
